﻿using System;
using System.Numerics;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace AIlin.Thresher
{
    [TestClass]
    public class ComplexMatrixSolverTest
    {
        ComplexMatrixSolver m_Solver = new ComplexMatrixSolver();
        public CSRMatrix<Complex> GenerateCSRMatrix1()
        {
            CSRMatrix<Complex> returnValue = new CSRMatrix<Complex>(0, 3);
            returnValue.AddRow(new FullVector<Complex>(3, new Complex[] { 1, 2, new Complex(3, 4) }));
            returnValue.AddRow(new FullVector<Complex>(3, new Complex[] { 3, 7, 9 }));
            returnValue.AddRow(new FullVector<Complex>(3, new Complex[] { new Complex(1, 2), 2, 3 }));
            return returnValue;
        }
        [TestMethod]
        public void TestMethod1()
        {
            var matrix = GenerateCSRMatrix1();

            Matrix<Complex> result = null;
            m_Solver.Addition(matrix, matrix, ref result);
            m_Solver.Multiply(result, 2, ref result);

            m_Solver.Multiply(result, 0.25, ref result);

            bool result1 = m_Solver.Equality(matrix, result);
            Assert.AreEqual(true, result1);
            
        }
    }
}
